const sentinel = require('redis-sentinel');
function test() {
  // List the sentinel endpoints
  var endpoints = [
    { host: '127.0.0.1', port: 26379 },
    { host: '127.0.0.1', port: 26380 },
    { host: '127.0.0.1', port: 26381 },
  ];

  var opts = {}; // Standard node_redis client options
  var masterName = 'mymaster';

  var redisClient = sentinel.createClient(endpoints, masterName, opts);
  // An equivalent way of doing the above (if you don't want to have to pass the endpoints around all the time) is
  // var Sentinel = sentinel.Sentinel(endpoints);
  // var masterClient = Sentinel.createClient(masterName, opts);
  // console.log('@masterClient: ', masterClient);
  redisClient.set('testName', 'lxjTest1');

}
function main() {
  try {
    test();
  } catch (error) {
    console.log('@@error', error);
  }

}

main();